package com.example.jason.myapplication;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.liaoinstan.springview.container.BaseHeader;

public class MyHead extends BaseHeader {

    @Override
    public View getView(LayoutInflater inflater, ViewGroup viewGroup) {
//        GifView gifView = new GifView(viewGroup.getContext());
//        TextView textView = new TextView(viewGroup.getContext());
//        textView.setText("qwerwqerqwerw");
        ImageView gifView = new ImageView(viewGroup.getContext());
        viewGroup.addView(gifView);
        gifView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
        ViewGroup.LayoutParams layoutParams = gifView.getLayoutParams();
        layoutParams.height = ViewGroup.LayoutParams.WRAP_CONTENT;
        layoutParams.width = ViewGroup.LayoutParams.WRAP_CONTENT;
        Glide.with(viewGroup.getContext()).asGif().load(R.drawable.pull_refresh_loading).into(gifView);
        return gifView;
    }

    @Override
    public void onPreDrag(View rootView) {

    }

    @Override
    public void onDropAnim(View rootView, int dy) {

    }

    @Override
    public void onLimitDes(View rootView, boolean upORdown) {

    }

    @Override
    public void onStartAnim() {

    }

    @Override
    public void onFinishAnim() {

    }
}
